﻿using System.Windows;
using System.Windows.Media;

namespace Lib.WPF.Dependents; 
/// <summary>
/// 标题栏附加属性（Color,Background,Margin,Padding,Height）
/// </summary>
public class Caption {

    /// <summary>
    /// 前景色属性
    /// </summary>
    public static readonly DependencyProperty ColorProperty = DependencyProperty.RegisterAttached("Color", typeof(Brush), typeof(Caption), new PropertyMetadata(default));
    /// <summary>
    /// 获取前景色
    /// </summary>
    public static Brush GetColor(DependencyObject e) => (Brush)e.GetValue(ColorProperty);
    /// <summary>
    /// 设置前景色
    /// </summary>
    public static void SetColor(DependencyObject e, Brush Value) => e.SetValue(ColorProperty, Value);


    /// <summary>
    /// 背景色属性
    /// </summary>
    public static readonly DependencyProperty BackgroundProperty = DependencyProperty.RegisterAttached("Background", typeof(Brush), typeof(Caption), new PropertyMetadata(default));
    /// <summary>
    /// 获取背景色
    /// </summary>
    public static Brush GetBackground(DependencyObject e) => (Brush)e.GetValue(BackgroundProperty);
    /// <summary>
    /// 设置背景色
    /// </summary>
    public static void SetBackground(DependencyObject e, Brush Value) => e.SetValue(BackgroundProperty, Value);


    /// <summary>
    /// 高度属性
    /// </summary>
    public static readonly DependencyProperty HeightProperty = DependencyProperty.RegisterAttached("Height", typeof(double), typeof(Caption), new PropertyMetadata(default));
    /// <summary>
    /// 获取高度
    /// </summary>
    public static double GetHeight(DependencyObject e) => (double)e.GetValue(HeightProperty);
    /// <summary>
    /// 设置高度
    /// </summary>
    public static void SetHeight(DependencyObject e, double Value) => e.SetValue(HeightProperty, Value);



    /// <summary>
    /// 标题栏右边区域外部边距属性
    /// </summary>
    public static readonly DependencyProperty MarginProperty = DependencyProperty.RegisterAttached("Margin", typeof(Thickness), typeof(Caption), new PropertyMetadata(default));
    /// <summary>
    /// 获取标题栏右边区域外部边距
    /// </summary>
    public static Thickness GetMargin(DependencyObject e) => (Thickness)e.GetValue(MarginProperty);
    /// <summary>
    /// 设置标题栏右边区域外部边距
    /// </summary>
    public static void SetMargin(DependencyObject e, Thickness Value) => e.SetValue(MarginProperty, Value);


    /// <summary>
    /// 标题栏右边区域内部边距属性
    /// </summary>
    public static readonly DependencyProperty PaddingProperty = DependencyProperty.RegisterAttached("Padding", typeof(Thickness), typeof(Caption), new PropertyMetadata(default));
    /// <summary>
    /// 获取标题栏右边区域内部边距
    /// </summary>
    public static Thickness GetPadding(DependencyObject e) => (Thickness)e.GetValue(PaddingProperty);
    /// <summary>
    /// 设置标题栏右边区域内部边距
    /// </summary>
    public static void SetPadding(DependencyObject e, Thickness Value) => e.SetValue(PaddingProperty, Value);


    /// <summary>
    /// 是否为沉浸式标题栏
    /// </summary>
    public static readonly DependencyProperty EnableProperty = DependencyProperty.RegisterAttached("Enable", typeof(bool), typeof(Caption), new PropertyMetadata(false));
    /// <summary>
    /// 是否为沉浸式标题栏
    /// </summary>
    public static bool GetEnable(DependencyObject e) => (bool)e.GetValue(EnableProperty);
    /// <summary>
    /// 是否为沉浸式标题栏
    /// </summary>
    public static void SetEnable(DependencyObject e, bool Value) => e.SetValue(EnableProperty, Value);
}
